#include<stdio.h>
#include<string.h>
#include<unistd.h>

#define NUM 101
void process()
{
  char bar[NUM];
  const char* label="|/\\";

  memset(bar,'\0',sizeof(bar));
  int cnt =0;
  while(cnt <=100)
  {
    printf("\033[47;31m[%-100s][%d\%][%c]\033[0m\r",bar,cnt,label[cnt%4]);
    fflush(stdout);
    bar[cnt++]='#';
    usleep(40000);
  }
  printf("\n");

}
int main()
{
  process();

  return 0;
}
